#!-*-coding:utf-8-*-
"""
协议
"""
from dbutil import *

# 注册
REGISTER_REQ = 1
REGISTER_ACK = 2
# 登录
LOGIN_REQ = 3
LOGIN_ACK = 4
# 世界聊天
WORLD_CHAT_REQ = 5
WORLD_CHAT_ACK = 6
# 私聊
PRIVATE_CHAT_REQ = 7
PRIVATE_CHAT_ACK = 8
# 房间聊天
ROOM_CHAT_REQ = 9
ROOM_CHAT_ACK = 10
# 退出登录
LOGOUT_REQ = 11
LOGOUT_ACK = 12
# 创建房间
CREATE_ROOM_REQ = 13
CREATE_ROOM_ACK = 14
# 进入房间
ENTER_ROOM_REQ = 15
ENTER_ROOM_ACK = 16
# 退出房间
LEAVE_ROOM_REQ = 17
LEAVE_ROOM_ACK = 18
# 查询房间列表
QUERY_ROOM_LIST_REQ = 19
QUERY_ROOM_LIST_ACK = 20
# 玩家发送21点游戏表达式
SEND_GAME21_EXPRESSION_REQ = 21
SEND_GAME21_EXPRESSION_ACK = 22
# 世界消息转发
WORLD_CHAT_MSG_TRANSFER = 100
# 房间消息转发
ROOM_CHAT_MSG_TRANSFER = 101
# 私聊消息转发
PRIVATE_CHAT_MSG_TRANSFER = 102
# 系统消息(例如通知某人上线、下线等)
SYSTEM_MSG_INFORM = 103

SUCCESS_OPERATION = 0
ERROR_NAME_HAS_BEEN_REGISTERED = 1
ERROR_NAME_NOT_EXIST = 2
ERROR_PWD = 3
ERROR_PEER_NAME_NOT_EXIST = 4
ERROR_PEER_NOT_ONLINE = 5
ERROR_NOT_JOIN_IN_ROOM = 6
ERROR_ACK_TIME_OUT = 7
ERROR_NOT_LOGIN = 8
ERROR_PRIVATE_CHAT_TO_SELF = 9
ERROR_REPEAT_LOGIN = 10
ERROR_SUCH_USER_NAME_HAS_BEEN_LOGINED = 11
ERROR_EXISTED_ROOM_NAME = 12
ERROR_HAVE_BEEN_IN_ROOM = 13
ERROR_REPEAT_ENTER_ROOM = 14
ERROR_NOT_IN_ROOM = 15
ERROR_ROOM_NAME_NOT_EXIST = 16
ERROR_GAME_INVALID_CHARACTER = 17
ERROR_GAME_INVLAID_EXPRESSION = 18
ERROR_NOT_IN_GAME_TIME = 19
ERROR_GAME_NOT_IN_ROOM = 20


ERROR_ROOM_CHAT_NOT_OPEN = 1000
